package util

import (
	"strconv"

	"github.com/gofiber/fiber/v2"
)

func GetCookieForMap(ctx *fiber.Ctx) map[string]interface{} {

	var cookieNameTypeString = [...]string{"telphone", "belong", "name", "expirestime", "token"}
	var cookieNameTypeInt = [...]string{"id", "identify", "creator"}
	var result = make(map[string]interface{})

	for _, v := range cookieNameTypeString {
		result[v] = ctx.Cookies(v)
	}
	for _, v := range cookieNameTypeInt {
		data, _ := strconv.Atoi(ctx.Cookies(v))
		result[v] = int32(data)
	}

	return result
}
